﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        MobileUpload.MobileUploadService mus = new Test.MobileUpload.MobileUploadService();// MobileUpload.MobileUploadService();
        MobileUpload.uploadMessage upmsg = new MobileUpload.uploadMessage();
        string fileName = @"E:\Developer\Olympus\p2.gif";
        private void button1_Click(object sender, EventArgs e)
        {
            System.IO.FileInfo fi = new System.IO.FileInfo(fileName);
            System.IO.FileStream fs = System.IO.File.OpenRead(fileName);
            byte[] fileByte = new byte[fi.Length];
            fs.Read(fileByte, 0, (int)fi.Length);
            upmsg.sender = "13811111111";
            upmsg.type = "0";
            upmsg.data = Convert.ToBase64String(fileByte);
            upmsg.dataLength = ((int)fi.Length).ToString();
            upmsg.fileType = fi.Extension.Substring(1);
            string[] str = new string[1];
            str[0] = "13800138000";
            upmsg.targetMsisdn = str;
           
            MessageBox.Show(mus.uploadMessage(upmsg));

        }
    }
}
